import request from '@/utils/request'        //request.js对Axios进行封装

//前端API与后端Swagger接口 对接

//查询品牌列表
export function listBrand(query) {
    return request({
        url: '/product/brand/list',
        method: 'get',
        params: query              //get对应params,post和put对应data
    })
}
    //新增品牌
    export function addBrand(data){
        return request({
            url:'/product/brand/add',
            method:'post',
          data
        })
}

//查询品牌详细
export function  getBrand(id){
    return request({
        url:`/product/brand/`+id,
        method:'get',
    })
}

//修改品牌
export function updateBrand(data){
    return request({
        url:'/product/brand',
        method:'put',
        data
    })
}

//删除品牌
export function delBrand(id){
    return request({
        url:'/product/brand/'+id,
        method:'delete'
    })
}

//获取全部品牌
export function getBrandAll(){
    return request({
        url:'/product/brand/getBrandAll',
        method:'get'
    })
}